<script setup lang="ts">
import { useRoute } from 'vue-router'

const route = useRoute()
</script>

<template>
  <div class="common-layout">
    <el-container>
      <el-aside>
        <el-menu
          :default-active="route.path"
          :default-openeds="['/member', '/member/myOrder']"
          router
          class="menu"
        >
          <el-sub-menu index="/member">
            <template #title>
              <span>我的账户</span>
            </template>
            <el-menu-item index="/member">会员中心</el-menu-item>
          </el-sub-menu>
          <el-sub-menu index="/member/myOrder">
            <template #title>
              <span>交易管理</span>
            </template>
            <el-menu-item index="/member/myOrder">我的订单</el-menu-item>
          </el-sub-menu>
        </el-menu>
      </el-aside>

      <router-view></router-view>
    </el-container>
  </div>
</template>

<style lang="scss" scoped>
.common-layout {
  width: 1300px;
  margin: 20px auto;
  .el-container {
    width: 100%;
    height: 600px;
    .el-aside {
      width: 150px;
      border: 1px solid rgba(0, 0, 0, 0.126);
    }
  }
}
</style>
